﻿using B.S.Filtration.ErrorCode;
using B.S.Filtration.Write.Api.Application.Command.ProductionTaskCommand;
using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.S.Filtration.Write.Api.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ProductionTaskController : ControllerBase
    {
        private readonly IMediator mediator;
        public ProductionTaskController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 专检申请添加
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<object>> AddProductionTask(AddProductionTaskCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 专检申请删除
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<int>> DelProductionTask(DelProductionTaskCommand request)
        {
            return await mediator.Send(request);
        }
        /// <summary>
        /// 专检申请修改
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<APIResult<int>> UpdateProductionTask(UpdateProductionTaskCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
